package vn.bum.game.om;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Game implements Serializable {
	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private String title;
	
	@Persistent
	private String code;

	@Persistent
	private String intro;
	
	@Persistent
	private Long catId;
	
	@Persistent
	private Text content;
	
	@Persistent
	private Integer fileSize;
	
	@Persistent
	private String jarUrl;
	
	@Persistent
	private String jadUrl;
	
	@Persistent
	private String imageUrl;

	public Long getId() {
		return id;
	}

	public String getContent() {
		return content==null ? null : content.getValue();
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setContent(Text content) {
		this.content = content;
	}

	public String getCode() {
		return code;
	}

	public Integer getFileSize() {
		return fileSize;
	}

	public void setFileSize(Integer fileSize) {
		this.fileSize = (fileSize == null) ? 0 : fileSize;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public String getJarUrl() {
		return jarUrl;
	}

	public void setJarUrl(String jarUrl) {
		this.jarUrl = jarUrl;
	}

	public String getJadUrl() {
		return jadUrl;
	}

	public void setJadUrl(String jadUrl) {
		this.jadUrl = jadUrl;
	}

	public Long getCatId() {
		return catId;
	}

	public void setCatId(Long catId) {
		this.catId = catId;
	}

	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setCode(String code) {
		this.code = code;
	}
}